/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package id3.utils;

import id3.models.RowData;
import java.util.ArrayList;

/**
 *
 * @author tungck
 */
public class Utils {
    
    public static ArrayList<RowData> cloneData(ArrayList<RowData> data_training) {
        ArrayList<RowData> data = new ArrayList<>();
        for (RowData row : data_training) {
            ArrayList<String> record_i = new ArrayList<>();
            for (String att_i : row.getRow()) {
                record_i.add(att_i);
            }
            RowData row_i = new RowData(record_i);
            data.add(row_i);
        }
        
        return data;
    }
    
    public static void print(ArrayList<RowData> data){
        for (RowData data1 : data) {
            System.out.println(data1.getRow().toString());
        }
    }

}
